package com.company;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;

public class weihu {
    private JTextField textField1;
    private JTextField textField2;
    private JTextField textField3;
    private JButton 维护Button;
    private JPanel panel1;

    public weihu() {
        JFrame student=new JFrame("学生信息维护");
        student.setSize(400,400);
        student.add(panel1);
        student.setLocation(400,250);
        student.setVisible(true);
        维护Button.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                String[] STU=new String[3];
                STU[0]=textField1.getText();
                STU[1]=textField2.getText();
                STU[2]=textField3.getText();
                ZSGC zs=new ZSGC();
                try {
                    zs.xuigai(STU);
                    JOptionPane.showConfirmDialog(null, "维护成功");
                } catch (SQLException ex) {
                    ex.printStackTrace();
                }

            }
        });
    }

    private void createUIComponents() {
        // TODO: place custom component creation code here
    }
}
